﻿using System;
//using System.Xml.Serialization;

namespace Futaba.SBus.Telemetry.Configuration
{
	/// <summary>
	/// Collection of flags honored by the <see cref="ITelemetryParser"/> during parsing of the
	/// slot's value
	/// </summary>
	[Flags]
	public enum SensorValueParsingFlags : int
	{
		
		//[XmlEnum("Default")]
		/// <summary>
		/// Default parsing-behavior (uses BitConverter.ToInt16())
		/// </summary>
		Default = 0x0,
		/// <summary>
		/// Only use the second byte's value
		/// </summary>
		ByteValue = 0x01,
		/// <summary>
		/// Reverse the order of the bytes, before interpreting them further
		/// </summary>
		ReverseByteOrder = 0x02,
		/// <summary>
		/// Treat the value unsigned (for RPM values, for example)
		/// </summary>
		IsUnsignedValue = 0x04,
		/// <summary>
		/// ignore new value, if it's less than 20% or more than 2x of the old value
		/// </summary>
		BogusValueDetection = 0x08,
		/// <summary>
		/// Must consume 2 slots!
		/// </summary>
		Coordinates = 0x10,
		/// <summary>
		/// deducts 0x40 from all Value1 values >= 0x40 before reading the int16
		/// </summary>
		Strip64 = 0x20,
	}
}
